<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <canvas id="canvas"></canvas>
    <script src="initCanvas.js"></script>
    <script>
        $(function ($) {
            console.log(canvas)
            var img = new Image()
            img.src = 'a.jpg'

            // context.translate(100, 100)
            // context.rotate(45 * Math.PI / 180)

            img.onload = function () {
                context.translate(50,50)
                // context.rotate(45 *Math.PI/180)
                context.drawImage(img, 0, 0,100,100,0,0,100,100)

                context.setTransform(1,0,0,1,0,0)
                context.translate(50,250)
                context.scale(1,-1)
                context.drawImage(img,0,0,100,100,0,0,100,100)
                
                context.setTransform(1,0,0,1,0,0)
                context.translate(250,250)
                context.scale(-1,-1)
                context.drawImage(img,0,0,100,100,0,0,100,100)
                
                context.setTransform(1,0,0,1,0,0)
                context.translate(250,50)
                context.scale(-1,1)
                context.drawImage(img,0,0,100,100,0,0,100,100)
            }
        })




    </script>

</body>

</html>